using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace Verlet
{
    class LimbPair : Constraint
    {
        public Limb left, right;
        Link linkage;
        public float spacing;

        public LimbPair(Node spine, float spacing, float radius, float upper, float lower)
        {
            left = new Limb(radius, upper, lower);
            right = new Limb(radius, upper, lower);
            linkage = new LinkWithMidpoint(left.root, spine, right.root, spacing, radius);
            this.spacing = spacing;
        }

        public override void Constrain()
        {
            left.Constrain();
            right.Constrain();
            linkage.Constrain();
        }

        public void Draw(Device d)
        {
            left.Draw(d);
            right.Draw(d);
            linkage.Draw(d);
        }

        public void Update()
        {
            left.Update();
            right.Update();
        }
    }
}
